<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>我和领导有话说</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=2.0, user-scalable=no" />
<meta content="telephone=no" name="format-detection"/>
<link href="/Public/projects/option/css/yjxBase.css" type="text/css" rel="stylesheet"/>
</head>
<body style="background-color:#eef3f7">
<div class="banner"><img src="/Public/projects/option/images/banner.jpg"></div>
<a href="/Wap/Tool/option_reply"><div class="myReply"></div></a>
<div class="bBox">
	<div class="divSelect">
        <div class="inputName"><p>选择领导</p><div class="unselectTriangel"></div></div>
        <ul class="ulSelect">
            <?php
            foreach($leader_arr as $key=>$name){
                echo '<li data-leader-id="' . $key . '">' . $name . '</li>';
            }
            ?>
        </ul>
    </div>
    <div class="divText"><textarea class="textArea" placeholder="请输入留言内容" id="content"></textarea></div>
    <div class="anonymous"><div class="checkBox iconfont"></div>匿名提交</div>
    <div class="tips" id="tips" style="display: none">手机号输入错误</div>
</div>
<button class="loginBtn marTop" onclick="view_add();">提&nbsp;&nbsp;&nbsp;&nbsp;交</button>
<div class="foot">浙江日报新闻发展有限公司</div>
<script src="/Public/js/jquery-1.11.0.min.js"></script>
<script>
    var leader_id = 0;
    var ireal_name = 0;
    function view_add(){
        if(leader_id == 0){
            $("#tips").text("请选择领导");
            $("#tips").css("display", "block");
        }
        var content = $("#content").val();
        if(content == ''){
            $("#tips").text("请输入留言内容");
            $("#tips").css("display", "block");
        }
        $.ajax({
            type:"post",
            dataType:'json',
            url:'/Wap/Tool/option_view_add',
            data:{
                leader_id:leader_id,
                content: content,
                ireal_name: ireal_name
            },
            success:function(res){
                if(res['code'] < 0){
                    window.location.href = '/Wap/Tool/option_index';
                }
                if(res['code'] == 0){
                    $("#tips").text(res['msg']);
                    $("#tips").css("display", "block");
                }
                if(res['code'] > 0){
                    window.location.href = '/Wap/Tool/option_reply';
                }
            }
        });
        return false;
    }
</script>
<script src="/Public/projects/option/js/common.js"></script>
<script src="/Public/js/common/baidutongji.js"></script>
</body>
</html>